<include file="public/layout"/>
<div id="append_parent"></div>
<div id="ajaxwaitid"></div>

<div class="page">
    <div class="fixed-bar">
        <div class="item-title">
            <div class="subject">
                <h3>矿机设置</h3>
                <h5>沙滩规则设置</h5>
            </div>
            <ul class="tab-base nc-row">
                <foreach name="group_list" item="v" key="k">
                    <li><a href="{:U('World.World/system',['inc_type'=> $k])}" <if condition="$k==$inc_type">class="current"</if>><span>{$v}</span></a></li>
                </foreach>
            </ul>
        </div>
    </div>
    <!-- 操作说明 -->
    <div class="explanation" id="explanation">
        <div class="title" id="checkZoom"><i class="fa fa-lightbulb-o"></i>
            <h4 title="提示相关设置操作时应注意的要点">操作提示</h4>
            <span id="explanationZoom" title="收起提示"></span></div>
        <ul>
            <li>切不可频繁更改</li>
        </ul>
    </div>
    <form method="post" enctype="multipart/form-data" name="form1" action="{:U('World.World/handle')}">
        <input type="hidden" name="inc_type" value="{$inc_type}">
        <div class="ncap-form-default">

            <dl class="row">
                <dt class="tit">
                    <label for="give_dc_reg">注册赠送DC：</label>
                </dt>
                <dd class="opt">
                    <input onKeyUp="this.value=this.value.replace(/[^\d]/g,'')" onpaste="this.value=this.value.replace(/[^\d]/g,'')" pattern="^\d{1,}$" id="give_dc_reg" name="give_dc_reg" value="{$config.give_dc_reg|default=0}" class="input-txt" type="text">个
                    <span class="err">只能输入整数</span>
                    <p class="notic">赠送的DC币将转换成贝壳，供用户捡贝壳，数值为0默认不赠送</p>
                </dd>
            </dl>

            <dl class="row">
                <dt class="tit">
                    <label for="ten_shell_num">沙滩贝壳数量：</label>
                </dt>
                <dd class="opt">
                    <input onKeyUp="this.value=this.value.replace(/[^\d]/g,'')" onpaste="this.value=this.value.replace(/[^\d]/g,'')" pattern="^\d{1,}$" id="ten_shell_num" name="ten_shell_num" value="{$config.ten_shell_num|default=0}" class="input-txt" type="text">
                    <span class="err">只能输入整数</span>
                     <p class="notic">沙滩最多显示的贝壳数量</p>
                </dd>
            </dl>
            <dl class="row">
                <dt class="tit">
                    <label for="ten_shell_num_min">捡贝壳最低值：</label>
                </dt>
                <dd class="opt">
                    <input onKeyUp="this.value=this.value.replace(/[^\d.]/g,'')" onpaste="this.value=this.value.replace(/[^\d.]/g,'')" pattern="^\d{1,}$" id="ten_shell_num_min" name="ten_shell_num_min" value="{$config.ten_shell_num_min|default=0}" class="input-txt" type="text">
                    <span class="err">只能输入整数</span>
                    <!-- <p class="notic">单位:%</p> -->
                </dd>
            </dl>
            <dl class="row">
                <dt class="tit">
                    <label for="ten_shell_num_max">捡贝壳最大值：</label>
                </dt>
                <dd class="opt">
                    <input onKeyUp="this.value=this.value.replace(/[^\d.]/g,'')" onpaste="this.value=this.value.replace(/[^\d.]/g,'')" pattern="^\d{1,}$" id="ten_shell_num_max" name="ten_shell_num_max" value="{$config.ten_shell_num_max|default=0}" class="input-txt" type="text">
                    <span class="err">只能输入整数</span>
                    <!-- <p class="notic">单位:%</p> -->
                </dd>
            </dl>
            <div class="bot"><a href="JavaScript:void(0);" class="ncap-btn-big ncap-btn-green" onclick="check_form()">确认提交</a></div>
        </div>
    </form>
</div>
<script type="text/javascript">

</script>
<div id="goTop">
    <a href="JavaScript:void(0);" id="btntop">
        <i class="fa fa-angle-up"></i>
    </a>
    <a href="JavaScript:void(0);" id="btnbottom">
        <i class="fa fa-angle-down"></i>
    </a>
</div>
</body>
<script>
    function check_form(){
        var ten_shell_num = $('input[name=ten_shell_num]').val();
        var ten_shell_num_min = $('input[name=ten_shell_num_min]').val();
        var ten_shell_num_max = $('input[name=ten_shell_num_max]').val();

        var error ='';
        if(ten_shell_num>6){
            error += "每天捡贝壳次数不能大于6次\n<br>";
        }
        if(ten_shell_num_min>=ten_shell_num_max){
            error += "捡贝壳最低值必须小于捡贝壳最高值\n";
        }

        if(error){
            layer.alert(error, {icon: 2});  //alert(error);
            return false;
        }
        document.form1.submit();
    }

</script>
</html>